package com.lottery.material.entity.transaction;

import com.lottery.material.entity.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * Description：交易记录表
 * Created by 朱正磊 on 2019-04-09 10:36
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = false)
@Table(name = "material_transaction_record")
public class TransactionRecord extends BaseEntity {

    private static final long serialVersionUID = 7074707059244831265L;

    @Column(columnDefinition = "varchar(50) not null comment '用户id'")
    private String userId;

    @Column(columnDefinition = "varchar(10) comment '交易类型编号'")
    private String transactionTypeCode;

    @Column(columnDefinition = "varchar(50) comment '交易标题'")
    private String transactionTitle;

    @Column(columnDefinition = "decimal(19,2) comment '支付总金额'")
    private BigDecimal payAmount;

    @Column(columnDefinition = "decimal(19,2) comment '用户收益金额'")
    private BigDecimal userAmount;

    @Column(columnDefinition = "decimal(19,2) comment '公司收益金额'")
    private BigDecimal companyAmount;

    @Column(columnDefinition = "decimal(5,2) comment '平台占比例（范围0~1之间）'")
    private BigDecimal platformScale;

    @Column(columnDefinition = "decimal(5,2) comment '作者占比例（范围0~1之间）'")
    private BigDecimal authorScale;

    @Column(columnDefinition = "decimal(19,2) comment '原始金额（涉及到公司收益需要保存交易原始金额）'")
    private BigDecimal originalAmount;

    @Column(columnDefinition = "decimal(19,2) comment '充值部分支付金额'")
    private BigDecimal buyPayAmount;

    @Column(columnDefinition = "decimal(19,2) comment '收益部分支付金额'")
    private BigDecimal profitPayAmount;

    @Column(columnDefinition = "int(1) comment '入账类型（1：收入；2：支出）'")
    private Integer billingType;

    @Column(columnDefinition = "int(11) comment '文章id（打赏或付费）'")
    private Integer articleId;

    @Column(columnDefinition = "varchar(10) comment '打赏理由编号（material_reward_reason_dict表reward_reason_code）'")
    private String rewardReasonCode;

}
